 <?php 

$username = $_GET['username'];
//$username='trang';

$actives = ($_GET['actives']!='false')? "'Active', ": "";
$pendings = ($_GET['pendings']!='false')? "'Pending', ": "";
$solds = ($_GET['solds']!='false')? "'Sold'": "";

$in = $actives.$pendings.$solds;

$in = trim($in);
$in = rtrim($in, ',');
$in = "(".$in.")";

include("../db/opendb.php");
include("functions.php");

$query = "select l.OID, l.LISTSTATUS, l.STREETNUM, l.STREETNAME, l.STREETSUFFIX, l.CITY, l.STATE from PROPERTIES l inner join Prop_Owner_Con p on p.Prop_OID = l.OID inner join Users u on u.ID = p.Owner where u.Username = '".$username."' and l.LISTSTATUS in ".$in." order by l.LISTSTATUS";

//echo $query;

$result = mysql_query($query) or die ("SQL Error".mysql_error());

$xml = getXML($result);

echo $xml;

?>
